package arithmetic;

/**
 * @author Ajie
 * @date 2019-11-30
 * @function
 */
public class A_00_OnLineTest {
    public static void main(String[] args) {

    }
    class Solution {
        public int climbStairs(int n) {
            //手写 网页程序测试
            if (n == 0 || n==1){
                return 1;
            }

            int[] res = new int[n+1];
            res[0] = 1;
            res[1] = 1;

            for (int i = 0; i <= n; i++) {
                res[i]=res[i-1]+res[i-2];
            }
            for(int i=2;i<=n; i++){
                res[i] = res[i-1]+res[i-2];
            }
            return res[n];
        }
    }
}
